import { createI18n } from 'vue-i18n'
import en from './lang/en'
import zh from './lang/zh'
import { RESUME_LOCALE } from '@/constant/localStore'

const messages = {
  en,
  zh
}

const locale = localStorage.getItem(RESUME_LOCALE) || 'zh'

const i18n = createI18n({
  legacy: false,
  locale: locale,
  globalInjection: true,
  messages
})

export default i18n
